bool isPalindrome(struct ListNode* head){
    struct ListNode *fast=head,*slow=head;
    if(!head)return true;
    //找链表中间
    while(fast)
    {
        fast=fast->next;
        if(!fast)break;
        fast=fast->next;
        slow=slow->next;
    }
    struct ListNode *mid=slow;
    struct ListNode *l1=mid,*l0=NULL,*l2=mid->next;
    while(l1)
    {
        l1->next=l0;
        l0=l1;
        l1=l2;
        if(l2!=NULL)
            l2=l2->next;  
    }
    while(head&&l0)
    {
        if(head->val!=l0->val)return false;
        head=head->next;
        l0=l0->next;
    }
    return true;
}